.class public Lcom/esfile/screen/recorder/media/util/t;
.super Ljava/lang/Object;
.source "MediaTypeUtil.java"


# direct methods
.method public static a(Ljava/lang/String;)Ljava/lang/String;
    .locals 1

    const/16 v0, 0xc

    new-array v0, v0, [B

    .line 1
    invoke-static {p0, v0}, Lcom/esfile/screen/recorder/media/util/t;->a(Ljava/lang/String;[B)Z

    move-result p0

    if-eqz p0, :cond_2

    .line 2
    invoke-static {v0}, Lcom/esfile/screen/recorder/media/util/t;->b([B)Z

    move-result p0

    if-eqz p0, :cond_0

    const-string p0, "dash"

    return-object p0

    .line 3
    :cond_0
    invoke-static {v0}, Lcom/esfile/screen/recorder/media/util/t;->a([B)Z

    move-result p0

    if-eqz p0, :cond_1

    const-string p0, "aac"

    return-object p0

    .line 4
    :cond_1
    invoke-static {v0}, Lcom/esfile/screen/recorder/media/util/t;->c([B)Z

    move-result p0

    if-eqz p0, :cond_2

    const-string p0, "mp3"

    return-object p0

    :cond_2
    const-string p0, "unknown"

    return-object p0
.end method

.method private static a(Ljava/lang/String;[B)Z
    .locals 3

    .line 10
    invoke-static {p0}, Lcom/esfile/screen/recorder/media/util/t;->b(Ljava/lang/String;)Z

    move-result v0

    const/4 v1, 0x0

    if-eqz v0, :cond_3

    if-eqz p1, :cond_3

    array-length v0, p1

    if-nez v0, :cond_0

    goto :goto_2

    .line 11
    :cond_0
    new-instance v0, Ljava/io/File;

    invoke-direct {v0, p0}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    const/4 p0, 0x0

    .line 12
    :try_start_0
    new-instance v2, Ljava/io/FileInputStream;

    invoke-direct {v2, v0}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_3
    .catchall {:try_start_0 .. :try_end_0} :catchall_1

    .line 13
    :try_start_1
    invoke-virtual {v2, p1}, Ljava/io/InputStream;->read([B)I

    move-result p0

    .line 14
    array-length p1, p1
    :try_end_1
    .catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    if-ne p0, p1, :cond_1

    const/4 v1, 0x1

    .line 15
    :cond_1
    :try_start_2
    invoke-virtual {v2}, Ljava/io/InputStream;->close()V
    :try_end_2
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_0

    :catch_0
    return v1

    :catchall_0
    move-exception p0

    goto :goto_0

    :catch_1
    move-object p0, v2

    goto :goto_1

    :catchall_1
    move-exception p1

    move-object v2, p0

    move-object p0, p1

    :goto_0
    if-eqz v2, :cond_2

    :try_start_3
    invoke-virtual {v2}, Ljava/io/InputStream;->close()V
    :try_end_3
    .catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_2

    .line 16
    :catch_2
    :cond_2
    throw p0

    :catch_3
    :goto_1
    if-eqz p0, :cond_3

    .line 17
    :try_start_4
    invoke-virtual {p0}, Ljava/io/InputStream;->close()V
    :try_end_4
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_4

    :catch_4
    :cond_3
    :goto_2
    return v1
.end method

.method public static a([B)Z
    .locals 4

    .line 5
    array-length v0, p0

    const/4 v1, 0x0

    const/4 v2, 0x2

    if-ge v0, v2, :cond_0

    return v1

    .line 6
    :cond_0
    aget-byte v0, p0, v1

    const/16 v2, 0xff

    and-int/2addr v0, v2

    if-ne v0, v2, :cond_1

    const/4 v0, 0x1

    aget-byte v2, p0, v0

    and-int/lit16 v2, v2, 0xf6

    const/16 v3, 0xf0

    if-ne v2, v3, :cond_1

    return v0

    .line 7
    :cond_1
    array-length v0, p0

    const/4 v2, 0x4

    if-lt v0, v2, :cond_2

    .line 8
    invoke-static {p0, v2}, Ljava/util/Arrays;->copyOf([BI)[B

    move-result-object p0

    const-string v0, "ADIF"

    .line 9
    invoke-virtual {v0}, Ljava/lang/String;->getBytes()[B

    move-result-object v0

    invoke-static {p0, v0}, Ljava/util/Arrays;->equals([B[B)Z

    move-result p0

    return p0

    :cond_2
    return v1
.end method

.method private static b(Ljava/lang/String;)Z
    .locals 1

    .line 4
    invoke-static {p0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_0

    new-instance v0, Ljava/io/File;

    invoke-direct {v0, p0}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result p0

    if-eqz p0, :cond_0

    const/4 p0, 0x1

    goto :goto_0

    :cond_0
    const/4 p0, 0x0

    :goto_0
    return p0
.end method

.method public static b([B)Z
    .locals 6

    .line 1
    array-length v0, p0

    const/4 v1, 0x0

    const/16 v2, 0xc

    if-ge v0, v2, :cond_0

    return v1

    :cond_0
    const-string v0, "ftypdash"

    .line 2
    invoke-virtual {v0}, Ljava/lang/String;->getBytes()[B

    move-result-object v0

    const/4 v3, 0x4

    :goto_0
    if-ge v3, v2, :cond_2

    add-int/lit8 v4, v3, -0x4

    .line 3
    aget-byte v4, v0, v4

    aget-byte v5, p0, v3

    if-eq v4, v5, :cond_1

    return v1

    :cond_1
    add-int/lit8 v3, v3, 0x1

    goto :goto_0

    :cond_2
    const/4 p0, 0x1

    return p0
.end method

.method public static c([B)Z
    .locals 4

    .line 1
    array-length v0, p0

    const/4 v1, 0x3

    const/4 v2, 0x0

    if-ge v0, v1, :cond_0

    return v2

    .line 2
    :cond_0
    invoke-static {p0, v1}, Ljava/util/Arrays;->copyOf([BI)[B

    move-result-object v0

    const-string v1, "ID3"

    .line 3
    invoke-virtual {v1}, Ljava/lang/String;->getBytes()[B

    move-result-object v1

    invoke-static {v0, v1}, Ljava/util/Arrays;->equals([B[B)Z

    move-result v0

    const/4 v1, 0x1

    if-eqz v0, :cond_1

    return v1

    .line 4
    :cond_1
    aget-byte v0, p0, v2

    const/16 v3, 0xff

    and-int/2addr v0, v3

    if-ne v0, v3, :cond_2

    aget-byte p0, p0, v1

    and-int/lit16 p0, p0, 0xfe

    const/16 v0, 0xfa

    if-ne p0, v0, :cond_2

    return v1

    :cond_2
    return v2
.end method
